using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;

namespace miciv.Misc
{
    public class FowardReserveList<T> : IReverseEnumerable
    {
        protected List<T> m_lstData;
        public List<T> Data
        {
            get
            {
                return this.m_lstData;
            }
        }

        public FowardReserveList()
        {
            this.m_lstData = new List<T>();
        }

        public IEnumerator<T> GetEnumerator()
        {
            return this.m_lstData.GetEnumerator();
        }

        public IEnumerable Reverse
        {
            get
            {
                for (int i = (this.m_lstData.Count - 1) ; -1 < i ; --i)
                {
                    yield return this.m_lstData[i];
                }
            }
        }

        public int Capacity
        {
            get
            {
                return this.m_lstData.Capacity;
            }
        }

        public bool Contains(T _item)
        {
            return this.m_lstData.Contains(_item);
        }

        public void Add(T _item)
        {
            this.m_lstData.Add(_item);
        }

        public void Remove(T _item)
        {
            this.m_lstData.Remove(_item);
        }

        public void Clear()
        {
            this.m_lstData.Clear();
        }

        public void Sort(Comparison<T> _comparison)
        {
            this.m_lstData.Sort(_comparison);
        }
    }
}
